<script type="text/javascript" src="<?php echo base_url("public/template/backend/plugins/ckeditor/ckeditor.js")?>"></script>
<script>
    $(function() {
        if(CKEDITOR.instances['data[content]']) {
            CKEDITOR.remove(CKEDITOR.instances['txt_content']); 
        } 
        CKEDITOR.config.width = 600;
        CKEDITOR.config.height = 150;
        CKEDITOR.replace('data[content]', {});
    })
</script>

<?php 
            $re = "/add/";
$str = uri_string();
if (preg_match($re, $str)) {
    $sub = TRUE;
} else {
    $sub = FALSE;
}
?>
<div class="title-menu">
    <h2><?php if($sub==TRUE) echo "Thêm mua hàng"; else echo "Sửa mua hàng";?></h2>
</div>
<nav class="bonus">
    <a href="<?php echo base_url("backend/buying");?>"><< Quay lại</a>
</nav>
<article>
    <form method="post" action="">
        <fieldset>
            <ul class="error">
                <?php echo validation_errors(); ?>               
            </ul>            
            <p>
                <label>Nội dung:</label>
                <textarea name="data[content]" id="data[content]"><?php if(isset($pro->content)) echo $pro->content; else echo set_value('data[content]');?></textarea>
            </p>
            <p>
                <label></label>
                <input type="submit" name="add" value="<?php if($sub == TRUE)echo "Thêm"; else echo "Sửa";?>"/>
            </p>
        </fieldset>
    </form>
</article>